package setting

import (
	"chrent.com/ServiceManage/utils"
	"gopkg.in/yaml.v2"
	"os"
)

type conf struct {
	Gobin      string `yaml:"gobin"`
	Production bool   `yaml:"production"`
	Domain     string `yaml:"domain"`
	Port       string `yaml:"port"`
	HomePath   string `yaml:"home_path"`
}

var Conf conf

func init() {
	b, err := os.ReadFile(utils.GetConf())
	if err != nil {
		panic(err)
	}
	err = yaml.Unmarshal(b, &Conf)
	if err != nil {
		panic(err)
	}
}
